import { VDomImp } from './abstract'

export class VirtualDom extends VDomImp {
  store;
  vnode;
  constructor(store) {
    super()
    this.store = store;
  }
  selector (model) {
    let component = Object.values(this.store.componentsMap).find((item) => {
      return model == item.model;
    });
    this.vnode = component
    return this;
  }
  set (key, value) {
    this.vnode.setOptions(key, value)
    return this
  }
  get (key) {
    return this.vnode.getOptions(key)
  }
}
